package offer;

 class offer53second {
}
class Solution53_2 {
    public int missingNumber(int[] nums) {
        int start =0;
        int end = nums.length-1;
        int mid;
        while (start<=end)
        {
            mid = (start+end)/2;
            if(mid==nums[mid])
            {
               start = mid+1;
            }
            else {
                end = mid-1;
            }
        }
        return start;
    }
}